package com.video.netty.send;

import com.qf.entity.ResultData;
import com.video.commons.sendaop.ISocketSend;
import com.video.commons.utils.TaskUtil;
import com.video.entity.Task;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 实时音乐,上一曲
 * {"id":"prevMusicTask","taskid":"145", "taskname":"Region","volume":"8",
 * "loopType":1, "mp3":["1.mp3","2.mp3","G.E.M.邓紫棋 - 喜欢你.mp3"] ,"terminal":["1", "2", "3"]}
 */
@Component
public class TaskPreSend extends ISocketSend {

    @Override
    public Map<String, Object> sendMsg(Object... objs) {

        Task task = ((ResultData<Task>) objs[0]).getData();
        Map<String, Object> map = TaskUtil.task2Map(task);
        map.put("id", "prevMusicTask");
        return map;
    }
}
